//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

namespace Microsoft.Research.ScientificWorkflow.UIDesigner.Monitor
{
    using System;
    using Microsoft.Research.eResearch.Subscriber.Interfaces;

    /// <summary>
    /// Specificiation for monitor service
    /// </summary>
    public interface IMonitorService
    {
        /// <summary>
        /// Raised whenever workflow instance created message is recieved from blackboard
        /// </summary>
        event EventHandler<BlackboardMessageReceivedEventArgs> WorkflowInstanceCreated;

        /// <summary>
        /// Raised whenever workflow instance completed message is recieved from blackboard
        /// </summary>
        event EventHandler<BlackboardMessageReceivedEventArgs> WorkflowInstanceCompleted;

        /// <summary>
        /// Raised whenever workflow, user or activity event message is recieved from blackboard
        /// </summary>
        event EventHandler<BlackboardMessageReceivedEventArgs> ProcessingStatus;

        /// <summary>
        /// Raised whenever activity event message is recieved from blackboard
        /// </summary>
        event EventHandler<BlackboardMessageReceivedEventArgs> ActivityMessage;

        /// <summary>
        /// Raised whenever workflow event message is recieved from blackboard
        /// </summary>
        event EventHandler<BlackboardMessageReceivedEventArgs> WorkflowMessage;

        /// <summary>
        /// Raised whenever user event message is recieved from blackboard
        /// </summary>
        event EventHandler<BlackboardMessageReceivedEventArgs> IterationEvent;

        /// <summary>
        /// Raised whenever a dataproduct event message is recieved from blackboard.
        /// </summary>
        event EventHandler<BlackboardMessageReceivedEventArgs> DataProductEvent;

        /// <summary>
        /// Raised whenever activity parameter value message is recieved from blackboard
        /// </summary>
        event EventHandler<BlackboardMessageReceivedEventArgs> InputOutput;

        /// <summary>
        /// Raised whenever resource utilization message is recieved from blackboard
        /// </summary>
        event EventHandler<BlackboardMessageReceivedEventArgs> ResourceUsage;

        /// <summary>
        /// Raised whenever message from blackboard is recieved
        /// </summary>
        event EventHandler<BlackboardMessageReceivedEventArgs> BlackboardMessageReceived;

        /// <summary>
        /// Raised whenever OutputDataProductReceived message is recieved from blackboard.
        /// </summary>
        event EventHandler<BlackboardMessageReceivedEventArgs> OutputDataProductReceived;

        /// <summary>
        /// Raised whenever datamodel needs to be cleared
        /// </summary>
        event EventHandler Clear;

        /// <summary>
        /// Start the subscriber if not already started
        /// </summary>
        /// <param name="jobId">Job id</param>
        void Start(Guid jobId);

        /// <summary>
        /// Stop the subscriber if already started
        /// </summary>
        void HaltService();

        /// <summary>
        /// Clears the subscribers
        /// </summary>
        void ClearModel();
    }
}
